(navigation image)
Home Animation & Cartoons | Arts & Music | Community Video | Computers & Technology | Cultural & Academic Films | Ephemeral Films | Movies | News & Public Affairs | Prelinger Archives | Spirituality & Religion | Sports Videos | Television | Videogame Videos | Vlogs | Youth Media
Search: Advanced Search
Anonymous User (login or join us) Upload

View movie

[item image]
View thumbnails
Run time: 23 minutes 23 seconds

Play / Download (help[help])

(31.8 M)Ogg Video
(59.7 M)h.264
(88.3 M)QuickTime


All Files: HTTP
[Attribution-Noncommercial-Share Alike 3.0]

Resources

Bookmark

Johan Falk/NodeOneLearn Drupal 13h: hook_entity_property_info_alter

You are using our new video/audio player!
I prefer flash (when possible)
Give us feedback!

This screencast is a part of the epic learning series "Four weeks of Drupal", chapter "Writing a module". You can view the full series at http://dev.nodeone.se/en/four-weeks-of-drupal.

Please post any comments over there, or we won't see them. Sorry.
---
This screencast shows how you can add information (properties) to the entities known by the Entity API module; in this case by adding the word list to the globally available "site" entity (which is not *really* an entity). This is done by implementing a hook: hook_entity_property_info_alter.
There is also some general information about alter hooks in Drupal.

(I accidentally removed the wordlist_get_list() function at the end of the screencast. This is restored in the next screencast. Sorry.)

code added to wordlist.module

/**
* Fetches the list of words as defined by Word list module.
* @return
* An array of words, not sanitized.
*/
function wordlist_get_list() {
return variable_get('wordlist_words', array());
}

/**
* Implements hook_entity_property_info_alter().
*/
function wordlist_entity_property_info_alter(&$info) {
$info['site']['properties']['wordlist_words'] = array(
'label' => t('Word list'),
'description' => t('A list of words, as defined by the Word list module.'),
'getter callback' => 'wordlist_get_list',
'sanitize' => 'check_plain',
'type' => 'list',
);
}

---
This screencast is a part of the epic learning series "Four weeks of Drupal", chapter "Writing a module". You can view the full series at http://dev.nodeone.se/en/four-weeks-of-drupal.

Please post any comments over there, or we won't see them. Sorry.


This movie is part of the collection: Community Video

Producer: Johan Falk/NodeOne
Audio/Visual: sound
Keywords: Drupal; 4 weeks of Drupal; NodeOne; coding

Creative Commons license: Attribution-Noncommercial-Share Alike 3.0


Individual Files

Movie Files QuickTime h.264 Ogg Video
Drupal 13h - hook_entity_property_info_alter 88.3 MB
59.7 MB
31.8 MB
Image Files Animated GIF Thumbnail
Drupal 13h - hook_entity_property_info_alter 242.1 KB
4.4 KB
Information FormatSize
LearnDrupal13hHook_entity_property_info_alter_files.xml Metadata [file]
LearnDrupal13hHook_entity_property_info_alter_meta.xml Metadata 2.3 KB

Be the first to write a review
Downloaded 59 times
Reviews


Terms of Use (10 Mar 2001)